package cn.wolfcode.p2p.util;

import java.math.BigDecimal;

public class Constant {
    //手机号码长度
    public static final int USERNAME_LENGTH = 11;

    //手机验证码最小长度
    public static final int VERIFYCODE_LENGTH = 4;

    //密码最小长度
    public static final int PASSWORD_MIN_LENGTH = 4;
    //密码最大长度
    public static final int PASSWORD_MAX_LENGTH = 16;

    //发送短信最小间隔
    public static final int SendMessageMinTime = 20;

    //短信失效时间
    public static final int VERIFYCODE_INVALID = 500;


    //发送短信网关
    public static final String SEND_URL = "http://utf8.api.smschinese.cn/?";

    //发送短信网关的注册的用户名
    public static final String SEND_UID = "AA63821728aa";

    //发送短信的密钥
    public static final String SEND_KEY = "d41d8cd98f00b204e980";


    /**
     * 显示精度
     */
    public static final int DISPLAY_SCALE = 2;

    /**
     * 存储精度
     */
    public static final int STORE_SCALE = 4;

    /**
     * 计算精度
     */
    public static final int CAL_SCALE = 8;

    // 按月分期还款(等额本息)
    public final static int RETURN_TYPE_MONTH_INTEREST_PRINCIPAL = 0;

    // 按月到期还款(每月还利息,到期还本息)
    public final static int RETURN_TYPE_MONTH_INTEREST = 1;

    // 普通信用标
    public final static int BIDREQUEST_TYPE_NORMAL = 0;
    // 债权标
    public final static int BIDREQUEST_TYPE_CREDITTRANSFER = 1;
    //体验标
    public final static int EXPERIENCE_BIDREQUEST_TYPE_CREDITTRANSFER = 2;

    public final static int BIDREQUEST_STATE_PUBLISH_STATE_APPLY = 11;  // 待审核
    public final static int BIDREQUEST_STATE_PUBLISH_PENDING = 0;   // 待发布
    public final static int BIDREQUEST_STATE_BIDDING = 1;           // 招标中 同债权招标
    public final static int BIDREQUEST_STATE_UNDO = 2;              // 已撤销 同债权撤销
    public final static int BIDREQUEST_STATE_BIDDING_OVERDUE = 3;   // 流标
    public final static int BIDREQUEST_STATE_APPROVE_PENDING_1 = 4; // 满标1审
    public final static int BIDREQUEST_STATE_APPROVE_PENDING_2 = 5; // 满标2审
    public final static int BIDREQUEST_STATE_REJECTED = 6;          // 满标审核被拒绝
    public final static int BIDREQUEST_STATE_PAYING_BACK = 7;       // 还款中
    public final static int BIDREQUEST_STATE_COMPLETE_PAY_BACK = 8; // 已还清 同债权转让
    public final static int BIDREQUEST_STATE_PAY_BACK_OVERDUE = 9;  // 逾期
    public final static int BIDREQUEST_STATE_PUBLISH_REFUSE = 10;   // 发标审核拒绝状态

    /**
     * 公告显示大小
     */
    public final static int ANNOUNCEMENT_PAGE_SIZE = 5;

    /**
     * 借款申请审核
     */
    public static final int APPLY_AUDIT = 0;
    /**
     * 满标1审
     */
    public static final int APPROVE_PENDING_1 = 1;
    /**
     * 满标2审
     */
    public static final int APPROVE_PENDING_2 = 2;


    /**
     * zero
     */
    public static final BigDecimal ZERO = new BigDecimal("0.0000");

    /**
     * 系统默认的信用额度
     */
    public static final BigDecimal DEFAULT_BORROW_LIMIT = new BigDecimal("5000.0000");

    /**
     * 管理员账号
     */

    public static final String MGR_USERNAME = "admin";

    /**
     * 管理员密码
     */

    public static final String MGR_PASSWORD = "123456";

    /**
     * 字典编码
     */
    /**
     * 月收入
     */
    public static final String ITEM_INCOMEGRADES = "incomeGrades";
    /**
     * 学历
     */
    public static final String ITEM_EDUCATIONBACKGROUNDS = "educationBackgrounds";
    /**
     * 婚姻
     */
    public static final String ITEM_MARRIAGES = "marriages";
    /**
     * 子女
     */
    public static final String ITEM_KIDCOUNTS = "kidCounts";
    /**
     * 住房条件
     */
    public static final String ITEM_HOUSECONDITIONS = "houseConditions";
    /**
     * 风控资料类型
     */
    public static final String ITEM_USERFILETYPES = "userFileTypes";

    public static final BigDecimal SMALLEST_BID_AMOUNT = new BigDecimal("50.0000");// 系统规定的最小投标金额
    public static final BigDecimal SMALLEST_BIDREQUEST_AMOUNT = new BigDecimal("500.0000");// 系统规定的最小借款金额
    public static final BigDecimal SMALLEST_CURRENT_RATE = new BigDecimal("5.0000");// 系统最小借款利息
    public static final BigDecimal MAX_CURRENT_RATE = new BigDecimal("20.0000");// 系统最大借款利息



    /**
     * 最小还款月数
     */

    public static final int MINIMUM_REPAYMENT_MONTH = 1;
    /**
     * 体验标还款月数
     */
    public static final int EXP_REPAYMENT_MONTH = 1;
    /**
     * 最大还款月数
     */
    public static final int MAXIMUM_REPAYMENT_MONTH = 12;

    /**
     * 系统最小招标天数
     */
    public static final int MINIMUM_TENDER_DAYS = 1;

    /**
     * 系统最大招标天数
     */
    public static final int MAXIMUM_NUMBER_OF_BIDDING_DAYS = 5;

    /**
     * 页面大小
     */
    public static final int PAGESIZE = 0;

    /** =============================账户流水类型================================ */

    // 资金流水类别：线下充值
    // 可用余额增加
    public final static int ACCOUNT_ACTIONTYPE_RECHARGE_OFFLINE = 0;

    // 资金流水类别：提现成功
    // 冻结金额减少
    public final static int ACCOUNT_ACTIONTYPE_WITHDRAW = 1;

    // 资金流水类别：成功借款
    // 可用余额增加
    public final static int ACCOUNT_ACTIONTYPE_BIDREQUEST_SUCCESSFUL = 2;

    // 资金流水类别：成功投标
    // 冻结金额减少
    public final static int ACCOUNT_ACTIONTYPE_BID_SUCCESSFUL = 3;

    // 资金流水类别：还款
    // 可用余额减少
    public final static int ACCOUNT_ACTIONTYPE_RETURN_MONEY = 4;

    // 资金流水类别：回款
    // 可用余额增加
    public final static int ACCOUNT_ACTIONTYPE_CALLBACK_MONEY = 5;

    // 资金流水类别：支付平台管理费
    // 可用余额减少
    public final static int ACCOUNT_ACTIONTYPE_CHARGE = 6;

    // 资金流水类别：利息管理费
    // 可用余额减少
    public final static int ACCOUNT_ACTIONTYPE_INTEREST_SHARE = 7;

    // 资金流水类别：提现手续费
    // 冻结金额减少
    public final static int ACCOUNT_ACTIONTYPE_WITHDRAW_MANAGE_CHARGE = 8;

    // 资金流水类别：充值手续费
    // 可用余额减少
    public final static int ACCOUNT_ACTIONTYPE_RECHARGE_CHARGE = 9;

    // 资金流水类别：投标冻结金额
    // 冻结金额增加 可用余额减少
    public final static int ACCOUNT_ACTIONTYPE_BID_FREEZED = 10;

    // 资金流水类别：取消投标冻结金额
    // 标审核失败
    // 冻结金额减少
    // 可用余额增加
    public final static int ACCOUNT_ACTIONTYPE_BID_UNFREEZED = 11;

    // 资金流水类别：提现申请冻结金额
    // 冻结金额增加
    // 可用余额减少
    public final static int ACCOUNT_ACTIONTYPE_WITHDRAW_FREEZED = 12;

    // 资金流水类别:提现申请失败取消冻结金额
    // 冻结金额减少
    // 可用余额增加
    public final static int ACCOUNT_ACTIONTYPE_WITHDRAW_UNFREEZED = 13;

    //资金流水类别:逾期还款缴纳滞纳金
    // 可用余额减少
    public static final int ACCOUNT_PAY_LATE_PAYMENT_FEE = 14;
    //资金流水类别:收取逾期还款缴纳滞纳金
    // 可用余额增加
    public static final int ACCOUNT_RECEIVE_PAY_LATE_PAYMENT_FEE = 15;

    //收取转让债权
    //可用余额增加
    public static final int TRANSFER_OF_CREDITOR_RIGHTS = 16;
    //认购债权
    //可用余额减少
    public static final int SUBSCRIPTION_CREDIT = 17;
    /**
     * 收取系统体验金,可用体验金余额增加
     */
    public static final int  RECEIVE_INITIAL_EXPERIENCE = 18;

    // 资金流水类别：收取体验标利息
    // 可用余额增加
    public static final int  RECEIVE_PAYMENT_EXPERIENCE_INTEREST = 19;

    /**
     * 体验金类型
     */
    public static final int INITIAL_EXPERIENCE = 0;//初始体验金


    /**
     * 间隔天数
     */
    public static final int INITIAL_EXPERIENCE_DAYS = 30;



    /** =========还款状态=============== */

    // 正常待还
    public final static int PAYMENT_STATE_NORMAL = 0;

    // 已还
    public final static int PAYMENT_STATE_DONE = 1;

    // 逾期
    public final static int PAYMENT_STATE_OVERDUE = 2;

    /** ============系统账户流水类型============= */

    // 系统账户收到账户管理费（借款管理费）
    public final static int SYSTEM_ACCOUNT_ACTIONTYPE_MANAGE_CHARGE = 1;

    // 系统账户收到利息管理费
    public final static int SYSTEM_ACCOUNT_ACTIONTYPE_INTREST_MANAGE_CHARGE = 2;

    // 系统账户收到提现手续费
    public final static int SYSTEM_ACCOUNT_ACTIONTYPE_WITHDRAW_MANAGE_CHARGE = 3;

    // 资金流水类别：体验标成功借款
    // 可用余额增加
    public final static int SYSTEM_ACCOUNT_ACTIONTYPE_BIDREQUEST_SUCCESSFUL = 4;

    // 资金流水类别：支付体验标利息
    // 可用余额减少
    public final static int SYSTEM_ACCOUNT_PAYMENT_EXPERIENCE_INTEREST = 5;
    // 资金流水类别：回退本金
    // 可用余额增加
    public final static int Return_Experience_Gold_Principal = 6;

    /** =========还款状态=============== */
    /**
     * 滞纳金率,日复利千分之八
     */
    public static final double LATE_PAYMENT_RATE = 0.008;
    /**
     * 公钥
     */
    public static final String  PRIVATE_KEY= "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJJqxunyHgxWN2aTSZp2jAYTOwGDeuS/Dkolk3g6/svnhVYAYn8iyjJ5Fo6YQcCz3F1+3YGjq1I1mIKRi3GaRoN3859vuCdo9nWFowF7BgepNSoGZY7uyYVc6EO3+TdeAlvdCceEng/a3hRoDcjLbsXdV9KwSfoCzdoRegy+yGf1AgMBAAECgYAHaRoaOyPkMfTp3yiJhdh+cji5UeNFcpoRjKdTHYFJ5rTr7mcN0j/zoAdRPkmNrEzJ+qLRbew84/ONIDqzjEBnUMRyWbq9rCr/yodld6uY8yQvXONGukv0mDArnsB+0HswkZ4oIMdHyw8EiCjcO+nBE63nc3ejw9XjBjwuUP/PwQJBAPtwxlwu9ORvn5LInQx/xEw6LWRn1kHuzU2V8QPuaZ1u/0MJ0Z1MqtEdWd4cUkox5etxpjAK8Ok7XUgfwcPdEjECQQCVEnep8vpDBxvokuz0bHARzGjUuZpMysBiTmbaUEwsAeCDj+rfQohISCF7GEDOargqKdlZ9XeBU5kZ/PEhf50FAkEA4r9/0o/x/rN/ByLtJeFux4NLfhl6Cblt4YLPd8kf6362qeEH7D/AZ5Z9faSyvQAkpN+3i+nB+cK0S59/4L7TcQJAeedtNew93Xw9xVYJMeRPTS7Ed1kEJlITOxD0KQlLER3D1LJnFoXY3osl3fy6WlKJIemxFVCXlomfhNIE+ijaZQJBANIxZSIC1qD9CA/RzPgxvpu0tjBN0u8Gak4lnUKtmBoBAyILoKkJ4ctElwqCpG4SAMLz6keWUYTUxXjrsR9sXiE=";

    /**
     * 私钥
     */

    public static final String PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSasbp8h4MVjdmk0madowGEzsBg3rkvw5KJZN4Ov7L54VWAGJ/IsoyeRaOmEHAs9xdft2Bo6tSNZiCkYtxmkaDd/Ofb7gnaPZ1haMBewYHqTUqBmWO7smFXOhDt/k3XgJb3QnHhJ4P2t4UaA3Iy27F3VfSsEn6As3aEXoMvshn9QIDAQAB";
    /**
     * 接口地址
     */
    public static final String URL = "http://localhost:1111/mgs/gateway.do";

    /**
     * 体验金账户初始金额
     */
    public static final BigDecimal EXPERIENCE_THE_INITIAL_AMOUNT_OF_GOLD = new BigDecimal("2000.0000");


     /**
     * 数据库的名称
     */
    public static final String MASTER = "master";
    public static final String SLAVE = "slave";

}
